package com.itheima.io1;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author zhangbaiyan
 * @date 2024-09-19 22:28
 * @description:
 * @version:
 */
public class test {
    public static void main(String[] args) throws IOException {
        /*
        演示:字节输出流FileOutputStream
        实现需求:写一段文字到本地文件中.(暂时不写中文)

        实现步骤:
            创建对象
            写出数据
            释放资源
         */

        //1.创建对象
        //写出 输出流 OutputStream
        //本地文件File
        FileOutputStream fos = new FileOutputStream("c.txt");
        byte[] bytes = {97,98,99,100,101};
        //2.写入数据
        fos.write(bytes,1,2);
        //3.释放资源
        fos.close();
    }
}
